$OpenBSD: patch-gnats_misc_c,v 1.2 2008/07/02 18:16:40 brad Exp $
--- gnats/misc.c.orig	Wed Nov 25 09:15:04 1998
+++ gnats/misc.c	Tue Jul  1 20:24:07 2008
@@ -71,15 +71,15 @@ log_msg (severity, has_arg, va_alist)
     message2 = va_arg (args, char *);
 
   if (has_arg)
-    sprintf (buf, "%s: %s %s\n", program_name, message, message2);
+    snprintf (buf, STR_MAX, "%s: %s %s\n", program_name, message, message2);
   else
-    sprintf (buf, "%s: %s\n", program_name, message);
+    snprintf (buf, STR_MAX, "%s: %s\n", program_name, message);
 
   if (debug_level >= severity)
     {
 #ifdef HAVE_SYSLOG_H
       if (log_method == SYSLOG)
-	syslog (severity, buf);
+	syslog (severity, "%s", buf);
       else
 #endif
       if (gnats_logfile != (FILE *) NULL)
@@ -170,14 +170,14 @@ get_next_field (line, token, delim)
   *t = '\0';
 
   /* erase whitespace at the end of the token */
-  while ((t > token) && (is_space[*(t-1)]))
+  while ((t > token) && (is_space[(u_char)*(t-1)]))
     *--t = '\0';
 
   if (! *line)
     return NULL;
   
   /* skip over any white space after delim */
-  while (*line != '\0' && is_space[*++line])
+  while (*line != '\0' && is_space[(u_char)*++line])
     /* Nothing */ ;
 
   t = strchr (line, '\n');
